// const httpException = require('../http')

const errCatch = async(ctx, next) => {
  try {
    await next()
  } catch (error) {
    ctx.body = '报错啦!'
    // if (error instanceof httpException) {
    //   ctx.body = {
    //     msg: error.msg, // error自带message参数
    //     error_code: error.errorCode,
    //     request: `${ctx.method}  ${ctx.path}`
    //   }
    //   ctx.status = error.code
    // }
  }
}
module.exports = errCatch